package com.practice.aiGenericsReflection009.generic;

/**
 * 最普通的泛型类
 * @author yangdejun
 * @date 2020/08/03
 **/
public class GenericClass01<T> {

    private T key;

    public GenericClass01(T key) {
        this.key = key;
    }

    public T getKey() {
        return key;
    }

    public static void main(String[] args) {
        GenericClass01 g1 = new GenericClass01("111");
        System.out.println(g1.getKey().getClass());
        System.out.println(g1.getKey());

        GenericClass01<Integer> g2 = new GenericClass01<>(1);
        System.out.println(g2.getKey().getClass());
        System.out.println(g2.getKey());
    }
}
